package com.vito.base.authoriza.service;

import java.util.List;
import java.util.Map;

import com.vito.base.authoriza.model.DeptModel;
import com.vito.base.exception.ParamErrorException;
import com.vito.base.model.DataGrid;
import com.vito.base.model.Result;

public interface DeptService {
	/**
	 * 查询dept信息分页展示
	 * @param dept 需要查询的参数条件
	 * @return DataGrid<DeptModel> 包含 rows 和total信息
	 * */
	public DataGrid<DeptModel> queryDeptByPage(Map<String, Object> dept);
	public List<DeptModel> queryDept(Map<String, Object> map);
	public List<DeptModel> queryDeptTree(DeptModel dept);
	public List<DeptModel> queryTreeAll(Map<String,Object> dept);
	public void saveDept(DeptModel dept) throws Exception;
	public Result saveDept2(DeptModel dept) throws Exception;
	public void deleteDept(DeptModel dept) throws ParamErrorException ;
	public void updateDept(DeptModel dept) throws Exception;
	public int saveDeptRole(DeptModel dept);
	// 查询所属系统
	public DeptModel queryDeptById(DeptModel dept);
	public List<DeptModel> queryDeptByUserID(String userId);
	//根据deptId获取deptName
	public String getDeptName(String deptId);
	/**
	 * 查找当前部门第一级父部门ID
	 * @param deptCode
	 * @return
	 */
	public String queryDeptParentId(String deptCode);
	/**
	 * 查找当前部门第一级父部门ID
	 * @param deptId
	 * @return
	 */
	public List<DeptModel> getDeptByPId(String pid);
	
	public List<DeptModel> findDeptTreeByUserId(Map<String,String> map);
	
	public List<DeptModel> getRootDept(String deptId);
	
	public List<Map<String, String>> queryDeptTreeByRootDept(String rootDept);
	public String queryDeptCodeById ( String  deptId);
}



